class TesteLoginFunctionalTests extends functionaltestplugin.FunctionalTestCase {
	
	private String defaultLocation = "http://localhost:9090/SPL_V3/login/auth"	
	 
    void testeTelaInicial() {
        get(this.defaultLocation)
		assertContentContains("Autentique-se")
    }
	void testeAcessoNegado(){

		get(this.defaultLocation);
		form('loginForm') {
			j_username = "administrador"
			j_password = "admin"
			click "Login"
		}
		assertContentContains("Usuario 'administrador' nao existe ou senha esta incorreta.")

	}

	void testeAcessoAdmin(){
		
		get(this.defaultLocation);
		form('loginForm') {
			j_username = "administrador"
			j_password = "administrador"
			click "Login"
		}
		assertStatus 200
	}
}

//grails -Dserver.port=9090 test-app -functional
//create-functional-test HelloWorld	